import { Ref, ref } from 'vue'

export function useTrigger(trigger = false): [Ref<boolean>, { trigger: () => void }] {
  const data = ref(trigger)
  function triggerFn() {
    data.value = !data.value
  }

  return [data, { trigger: triggerFn }]
}
